<template>
  <div>
    <van-sticky>
      <div class="title">
        <van-icon name="arrow-left" class="icon" @click="$router.back()" />
        <div class="tab"><span v-for="(item,index) in menList" :key="index" :class="formData.tab== item.id ? 'tabactive' : '' " @click="getTab(item.id)">{{item.name}}</span>
        </div>
      </div>
    </van-sticky>
    <BlindBox v-if="formData.propType==3" />
    <Collection v-else />

  </div>
  <!-- <van-tabs v-model:active="active" v-for="(item,index) in tabList" :key="index">
    <van-tab :title="item.name"></van-tab>
  </van-tabs> -->

</template>
<script>
import { ref, defineComponent, reactive, onMounted, toRefs, nextTick, computed } from "vue";
import { ipageByUserCollection, ipageByUserBlindBox } from "@/api/public";
import { Toast } from "vant";
import { useStore } from "vuex";
import { useRouter } from "vue-router"
import BlindBox from "./node/BlindBox.vue";
import Collection from "./node/Collection.vue";
export default {
  components: {
    BlindBox, Collection
  },
  setup() {
    const DataList = ref([])
    const store = useStore();
    const router = useRouter()
    const user_info = computed(() => {
      return store.getters.user_info
    })
    const menList = reactive([
      {
        id: 0, name: "藏品"
      },
      {
        id: 3, name: "盲盒"
      },
      // {
      //   id: 2, name: "市场"
      // }

    ])
    const formData = reactive({
      tab: 0,
      pageNum: 1,
      pageSize: 10,
      active: 0,
      total: 0,
      type: null,
      loading: true,
      finished: false,
      isActive: true,
      hasError: false,
      propType: 0

    })
    const getTab = async (id) => {
      DataList.value = []
      formData.tab = id
      formData.propType = id
      formData.pageNum = 1
      formData.loading = false
      formData.refreshing = true
    }


    return {
      menList,
      formData,


      getTab
    }
  }

}
</script>

<style lang="less" scoped>
.videoContainer {
  background: linear-gradient(0deg, #161718, #4b4c4d);
  border: 2px solid #ffffff;
  border-radius: 20px;
  overflow: hidden;
  width: 200px;
  height: 200px;

  .fullscreenVideo {
    width: 100%;
  }
}
&:deep(.van-tabs__wrap) {
  background: transparent;
}
&:deep(.van-tabs__nav) {
  background: transparent !important;
  margin: 0px 20px;
}
&:deep(.van-tab) {
  font-size: 31px;
  font-family: Source Han Sans CN;
  font-weight: 400;
  color: #ffffff;
  opacity: 0.8;
}
&:deep(.van-tab--active) {
  .van-tab__text {
    font-size: 36px;
    font-family: Source Han Sans CN;
    font-weight: bold;
    line-height: 30px;
    background: linear-gradient(-90deg, #37dc6d 0%, #34d1f9 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }
}
&:deep(.van-tabs__line) {
  background: url('../../../assets/image/tab-active.png');
  background-size: 100% 100%;
  bottom: 40px !important;
}
ul {
  margin: 0px 20px;
  li {
    background: #282a2c;
    border-radius: 20px;
    margin-top: 30px;
    padding: 20px 20px;
    .img-box {
      width: 200px;
      height: 200px;
      background: linear-gradient(0deg, #161718, #4b4c4d);
      border: 2px solid #ffffff;
      border-radius: 20px;
      overflow: hidden;
      img {
        width: 100%;
        height: 100%;
      }
    }
    .record-cont {
      h1 {
        height: 30px;
        font-size: 32px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #ffffff;
        line-height: 53px;
        margin: 0px;
      }
      h2 {
        height: 25px;
        font-size: 26px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #b9c4c7;
        line-height: 48px;
        margin-top: 25px;
      }
      p {
        height: 20px;
        font-size: 26px;
        font-family: Source Han Sans CN;
        font-weight: 300;
        color: #b9c4c7;
        line-height: 48px;
      }
    }
    .space-between {
      display: flex;
      flex-direction: column;
      justify-content: space-between;
      align-items: flex-end;
      span {
        font-size: 32px;
        font-family: Source Han Sans CN;
        font-weight: 400;
        color: #ffffff;
        line-height: 73px;

        background: linear-gradient(-90deg, #37dc6d 0%, #34d1f9 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }
      p {
        font-size: 40px;
        font-family: Source Han Sans CN;
        font-weight: bold;
        color: #ffffff;
        line-height: 73px;

        background: linear-gradient(-90deg, #37dc6d 0%, #34d1f9 100%);
        -webkit-background-clip: text;
        -webkit-text-fill-color: transparent;
      }
    }
  }
}
.title {
  .tabactive {
    font-size: 36px !important;
    font-weight: bold !important;
    color: #ffffff !important;
  }
  padding-left: 20px;
  height: 80px;
  background: #222;
  display: flex;
  align-items: center;
  &:deep(.icon) {
    color: #ffffff;
    font-size: 50px;
  }
  .tab {
    padding-left: 40px;
    span {
      font-size: 36px;
      font-family: Source Han Sans CN;
      font-weight: 400;
      color: #b9c4c7;
      display: inline-block;
      margin-right: 80px;
    }
  }
}
</style>